From: Carlos Garnacho Date: Tue, 27 Nov 2018 12:36:26 +0000 (+0100) Subject: overview: Do not warp pointer to fake crossing event X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~80 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=23c3f3fdeae608de422472802ac42261ff8f55fe;p=gnome-shell.git overview: Do not warp pointer to fake crossing event This is actually papering over bugs in toolkits. On X11 the Xserver will send crossing events when the stage input shape changes. As those go end up ignored in GTK+, this warp call aims (and randomly manages) to send a motion event that wouldn't go unlistened by the drag source window (the one holding the grab). This bug actually manifests in other ways, eg. by changing the window beneath the pointer with alt-tab while DnDing. This should be fixed altogether in the client side. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/317 --- diff --git a/js/ui/overview.js b/js/ui/overview.js index ae60e1a24..e92b21e50 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -2,13 +2,11 @@ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; -const Gtk = imports.gi.Gtk; const Meta = imports.gi.Meta; const Mainloop = imports.mainloop; const Signals = imports.signals; const St = imports.gi.St; const Shell = imports.gi.Shell; -const Gdk = imports.gi.Gdk; const Background = imports.ui.background; const DND = imports.ui.dnd; @@ -158,7 +156,6 @@ var Overview = class { this._windowSwitchTimestamp = 0; this._lastActiveWorkspaceIndex = -1; this._lastHoveredWindow = null; - this._needsFakePointerEvent = false; if (this._initCalled) this.init(); @@ -306,19 +303,9 @@ var Overview = class { if (this._windowSwitchTimeoutId != 0) { Mainloop.source_remove(this._windowSwitchTimeoutId); this._windowSwitchTimeoutId = 0; - this._needsFakePointerEvent = false; } } - _fakePointerEvent() { - let display = Gdk.Display.get_default(); - let deviceManager = display.get_device_manager(); - let pointer = deviceManager.get_client_pointer(); - let [gdkScreen, pointerX, pointerY] = pointer.get_position(); - - pointer.warp(gdkScreen, pointerX, pointerY); - } - _onDragMotion(dragEvent) { let targetIsWindow = dragEvent.targetActor && dragEvent.targetActor._delegate && @@ -340,7 +327,6 @@ var Overview = class { this._windowSwitchTimeoutId = Mainloop.timeout_add(DND_WINDOW_SWITCH_TIMEOUT, () => { this._windowSwitchTimeoutId = 0; - this._needsFakePointerEvent = true; Main.activateWindow(dragEvent.targetActor._delegate.metaWindow, this._windowSwitchTimestamp); this.hide(); @@ -643,12 +629,6 @@ var Overview = class { Main.layoutManager.hideOverview(); this._syncGrab(); - - // Fake a pointer event if requested - if (this._needsFakePointerEvent) { - this._fakePointerEvent(); - this._needsFakePointerEvent = false; - } } toggle() {